package com.hundsun.yr.universal.p2p.config;

import android.content.Context;

import com.hundsun.yr.universal.library.data.HSSharedPreferences;

import java.util.HashMap;

/**
 * Created by xx on 2017/4/16.
 * 网络请求参数设置和拼接
 */
public class ApiConstants2 {
    private Context context;
    /**
     * 存储用户个人信息的sp
     */
    private HSSharedPreferences mSharedPreferences;

    public ApiConstants2(Context context) {
        this.context = context;
        mSharedPreferences = new HSSharedPreferences(context, Config.SPPath.file_userLoginedInfo);
    }

    /**
     * login接口参数
     *
     * @param
     * @return HashMap<String, String>
     */
    public static HashMap<String, String> login(String phone, String passwd, String sign, String timeStamp, String data) {
        HashMap<String, String> hashMap = new HashMap<>();
//        hashMap.put("phone",phone);
//        hashMap.put("passwd",passwd);
        hashMap.put("data", data);
        hashMap.put("sign", sign);
        hashMap.put("timestamp", timeStamp);
//        Log.e("aaaaaaaaaaaaaaaaaaaaaa: " + hashMap.toString());
        return hashMap;
    }

    /**
     * goodsChoicest，精品产品
     *
     * @param utime
     * @return
     */
    public static HashMap<String, String> goodsChoicest(String utime) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("utime", utime);
        return hashMap;
    }

    /**
     * 首页精选产品
     *
     * @param top
     * @return
     */
    public static HashMap<String, String> topGoodsChoicest(String top) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("top", top);
        return hashMap;
    }

    /**
     * 上传Location
     * @param latitude
     * @param longitude
     * @return
     */
    public static HashMap<String, String> getLocation(String latitude,String longitude) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("lat", latitude);
        hashMap.put("lon", longitude);
        return hashMap;
    }

    /**
     * 获取注册验证码
     *
     * @return
     */
    public static HashMap<String, String> registsms(String phone) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("phone", phone);
        return hashMap;
    }

    /**
     * 注册接口的参数
     *
     * @param str
     * @return
     */
    public static HashMap<String, String> register(String... str) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("phone", str[0]);
        hashMap.put("passwd", str[1]);
        hashMap.put("code", str[2]);
        hashMap.put("inviter", str[3]);
        return hashMap;
    }

    /**
     * 商品详情页面
     *
     * @param goodsid
     * @return
     */
    public static HashMap<String, String> goodsDetail(String goodsid) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("goodsid", goodsid);
        return hashMap;
    }

/*    *//**
     * 投资
     * @param amount
     * @param discountId
     * @param disCountAMT
     * @return
     *//*
    public static HashMap<String,String> invest(String amount, String discountId,String disCountAMT){
        HashMap<String,String> hashMap = new HashMap<>();
        hashMap.put("amount",amount);
        hashMap.put("discountId",discountId);
        hashMap.put("disCountAMT",disCountAMT);
        return hashMap;
    }*/

    /**
     * 获取验证码
     *
     * @param phone
     * @return
     */
    public static HashMap<String, String> loginsms(String phone) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("phone", phone);
        return hashMap;
    }

    /**
     * 优惠抵扣卷
     *
     * @param goodsid
     * @return
     */
    public static HashMap<String, String> discount(String goodsid) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("goodsid", goodsid);
        return hashMap;
    }

    /**
     * @param utime
     * @return
     */
    public static HashMap<String, String> index(String utime) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("utime", utime);
        return hashMap;
    }

    /**
     * 查询借款详情
     *
     * @param loanId
     * @return
     */
    public static HashMap<String, String> loanId(String loanId) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("loanId", loanId);
        return hashMap;
    }
}
